package action

import (
	"github.com/kataras/iris/v12/context"
	"github.com/kataras/iris/v12/mvc"
	"io"
)

type ServerErrorResult struct {
}

// Dispatch writes the response result to the context's response writer.
func (r *ServerErrorResult) Dispatch(ctx *context.Context) {
	ctx.ResponseWriter().WriteHeader(500)
	_, _ = io.WriteString(ctx.ResponseWriter(), "Server Error")
}

func RawError() mvc.Result {
	return &ServerErrorResult{}
}
